import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
 
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "participant", propOrder = { "fieldOfStudy", "firstName",
        "lastName", "matriculationNumber" })
@XmlRootElement(name="participant")
public class Participant {
 
    protected String fieldOfStudy;
    protected String firstName;
    protected String lastName;
    protected String matriculationNumber;
    
    public Participant(){
        
    }
    
    public Participant(String fieldOfStudy, String firstName, String lastName,
            String matriculationNumber) {
        super();
        this.fieldOfStudy = fieldOfStudy;
        this.firstName = firstName;
        this.lastName = lastName;
        this.matriculationNumber = matriculationNumber;
    }
 
    public String getFieldOfStudy() {
        return fieldOfStudy;
    }
 
    public void setFieldOfStudy(String value) {
        this.fieldOfStudy = value;
    }
 
    public String getFirstName() {
        return firstName;
    }
 
    public void setFirstName(String value) {
        this.firstName = value;
    }
 
    public String getLastName() {
        return lastName;
    }
 
    public void setLastName(String value) {
        this.lastName = value;
    }
 
    public String getMatriculationNumber() {
        return matriculationNumber;
    }
 
    public void setMatriculationNumber(String value) {
        this.matriculationNumber = value;
    }
 
    @Override
    public String toString() {
        return this.getMatriculationNumber() + " " + this.getFirstName() + " "
                + this.getLastName() + " " + this.getFieldOfStudy();
    }
 
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result
                + ((fieldOfStudy == null) ? 0 : fieldOfStudy.hashCode());
        result = prime * result
                + ((firstName == null) ? 0 : firstName.hashCode());
        result = prime * result
                + ((lastName == null) ? 0 : lastName.hashCode());
        result = prime
                * result
                + ((matriculationNumber == null) ? 0 : matriculationNumber
                        .hashCode());
        return result;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final Participant other = (Participant) obj;
        if (fieldOfStudy == null) {
            if (other.fieldOfStudy != null)
                return false;
        } else if (!fieldOfStudy.equals(other.fieldOfStudy))
            return false;
        if (firstName == null) {
            if (other.firstName != null)
                return false;
        } else if (!firstName.equals(other.firstName))
            return false;
        if (lastName == null) {
            if (other.lastName != null)
                return false;
        } else if (!lastName.equals(other.lastName))
            return false;
        if (matriculationNumber == null) {
            if (other.matriculationNumber != null)
                return false;
        } else if (!matriculationNumber.equals(other.matriculationNumber))
            return false;
        return true;
    }
}